

<%@ page import="domain.Peca" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'peca.label', default: 'Peca')}" />
        <title><g:message code="default.create.label" args="[entityName]" /></title>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></span>
            <span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></span>
        </div>
        <div class="body">
            <h1><g:message code="default.create.label" args="[entityName]" /></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${pecaInstance}">
            <div class="errors">
                <g:renderErrors bean="${pecaInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:form action="save" >
                <div class="dialog">
                    <table>
                        <tbody>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="assunto"><g:message code="peca.assunto.label" default="Assunto" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: pecaInstance, field: 'assunto', 'errors')}">
                                    <g:textField name="assunto" value="${pecaInstance?.assunto}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="ativo"><g:message code="peca.ativo.label" default="Ativo" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: pecaInstance, field: 'ativo', 'errors')}">
                                    <g:checkBox name="ativo" value="${pecaInstance?.ativo}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="conteudoHTML"><g:message code="peca.conteudoHTML.label" default="Conteudo HTML" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: pecaInstance, field: 'conteudoHTML', 'errors')}">
                                    <g:textField name="conteudoHTML" value="${pecaInstance?.conteudoHTML}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="conteudoHTMLOriginal"><g:message code="peca.conteudoHTMLOriginal.label" default="Conteudo HTMLO riginal" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: pecaInstance, field: 'conteudoHTMLOriginal', 'errors')}">
                                    <g:textField name="conteudoHTMLOriginal" value="${pecaInstance?.conteudoHTMLOriginal}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="conteudoTexto"><g:message code="peca.conteudoTexto.label" default="Conteudo Texto" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: pecaInstance, field: 'conteudoTexto', 'errors')}">
                                    <g:textField name="conteudoTexto" value="${pecaInstance?.conteudoTexto}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="conteudoTextoOriginal"><g:message code="peca.conteudoTextoOriginal.label" default="Conteudo Texto Original" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: pecaInstance, field: 'conteudoTextoOriginal', 'errors')}">
                                    <g:textField name="conteudoTextoOriginal" value="${pecaInstance?.conteudoTextoOriginal}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="date"><g:message code="peca.date.label" default="Date" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: pecaInstance, field: 'date', 'errors')}">
                                    <g:datePicker name="date" precision="day" value="${pecaInstance?.date}"  />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="descricao"><g:message code="peca.descricao.label" default="Descricao" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: pecaInstance, field: 'descricao', 'errors')}">
                                    <g:textField name="descricao" value="${pecaInstance?.descricao}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="nomeRemetente"><g:message code="peca.nomeRemetente.label" default="Nome Remetente" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: pecaInstance, field: 'nomeRemetente', 'errors')}">
                                    <g:textField name="nomeRemetente" value="${pecaInstance?.nomeRemetente}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="pecaEmail"><g:message code="peca.pecaEmail.label" default="Peca Email" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: pecaInstance, field: 'pecaEmail', 'errors')}">
                                    <g:select name="pecaEmail.id" from="${domain.PecaEmail.list()}" optionKey="id" value="${pecaInstance?.pecaEmail?.id}"  />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="url"><g:message code="peca.url.label" default="Url" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: pecaInstance, field: 'url', 'errors')}">
                                    <g:textField name="url" value="${pecaInstance?.url}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="usuario"><g:message code="peca.usuario.label" default="Usuario" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: pecaInstance, field: 'usuario', 'errors')}">
                                    <g:select name="usuario.id" from="${domain.Usuario.list()}" optionKey="id" value="${pecaInstance?.usuario?.id}"  />
                                </td>
                            </tr>
                        
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><g:submitButton name="create" class="save" value="${message(code: 'default.button.create.label', default: 'Create')}" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
